﻿<?php $this->load->view('layout/header'); ?>

<script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['form1'];
    if (!theForm) {
        theForm = document.form1;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
</script>
<script type="text/javascript">
    //<![CDATA[
    function WebForm_OnSubmit() {
        if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
        return true;
    }
    //]]>
</script>
<form name="form1" method="post" action="<?php echo site_url('photo/photo_action').'/'.$info['photoid'];?>" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
    <div>
    </div>
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    <span id="lblTitle">添加</span>相册
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    相册名称：
                </td>
                <td>
                    <input type="text" name="photoname" value="<?php echo $info['photoname']; ?>" id="photoname">
                    <span id="languagever_tips" style="color:Red;display:none;">不能为空</span>
                    <input type="hidden" name="photoid" value="<?php echo $info['photoid']; ?>">
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>所属栏目：
                </td>
                <td>
                    <select name="classid">
                        <option value="">请选择</option>
                        <?php foreach($class as $key=>$val) : ?>
                            <option value="<?php echo $val['classid']; ?>" <?php if($val['classid'] == $info['classid']){echo 'selected';}?>><?php echo $val['classname']; ?></option>
                        <?php endforeach; ?>
                    </select>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>相册描述：
                </td>
                <td>
                    <textarea name="description" cols="20" rows="2" style="height:100px;width:200px;"><?php echo $info['description']; ?></textarea>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>排序号：
                </td>
                <td>
                    <input name="listid" num="true" type="text" value="<?php echo $info['list']?$info['list']:0;?>" id="listid" />
                    <span id="listid_tips" style="color:Red;display:none;">不能为空</span>
                    <span id="listid_num_tips" style="color:Red;display:none;">只能为数字</span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">&nbsp;
                    
                </td>
                <td colspan="3">
                    <input type="submit" value="保存" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSave" />
                    <input type="button" value="返回" onclick="javascript:history.go(-1);" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
    </div>
</form>
<script type="text/javascript">
    $('#form1').submit(function() {
        var is = true;
        if (!input_tips($('#languagever'))) {
            is = false;
        }
        if (!input_tips($('#websitename'))) {
            is = false;
        }
        if (!input_tips($('#websitedir'))) {
            is = false;
        }
        if (!input_tips($('#listid'))) {
            is = false;
        }
        return is;
    });
</script>
</body>
</html>

